package com.chencs.common.lmadmin.controller;

import com.alibaba.fastjson.JSON;
import com.chencs.app.AppCommon;
import com.chencs.common.lmadmin.service.LmFinanceService;
import com.chencs.vo.biz.lianmeng.LmMember;
import com.chencs.vo.biz.lianmeng.LmWithdraw;
import com.chencs.vo.net.response.ResponseBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2018-7-28.
 */
@RestController
@RequestMapping("/m/lmfinance")
public class LmFinanceController  {


    @Autowired
    private LmFinanceService service;

    @RequestMapping(value = "/getList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String withdrawList() {
        List<LmWithdraw> withdraws = service.withdrawList();
        return JSON.toJSON(withdraws).toString();
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String updateLmWithdraw(@RequestBody LmWithdraw withdraw) {
        ResponseBase response = new ResponseBase();
          service.updateLmWithdraw(withdraw);
        response.setMsg("修改成功");
        response.setCode(AppCommon.SUCCESS);
        return JSON.toJSON(response).toString();
    }




}
